package com.simple.structure.adapter.sample2;

import com.simple.LogUtil;

/**
 * 对象的适配器模式
 * 类Source的实例需要转换成满足另一个接口的新对象
 *
 * @author simple
 * @version 1.0
 * @date 2018-12-12 09:14
 * @since 1.0
 */
public class Adapter implements Targetable {
    private Source source;

    public Adapter(Source source) {
        this.source = source;
    }

//    @Override
//    public void method1() {
//        source.method1();
//    }

    @Override
    public void method2(String name) {
        source.method1("调用需要适配的方法");
        LogUtil.info("This is target method ---> " + name);
    }
}
